/** 
 * File-Name:UserDao.java
 *
 * Created on 2011-6-2 下午09:12:54
 * 
 * @author: Neo (neolimeng@gmail.com)
 * Software Engineering Institute, Peking University, China
 * 
 * Copyright (c) 2009, Peking University
 * 
 *
 */
package site.dao;

import java.sql.Connection;
import java.sql.SQLException;

import neoutil.CommonDao;
import site.entity.User;

/**
 * Description:
 * 
 * @author: Neo (neolimeng@gmail.com) Software Engineering Institute, Peking
 *          University, China
 * @version 1.0 2011-6-2 下午09:12:54
 */
public class UserDao extends CommonDao<User, Long> {
	private String SQL_INSERT = "INSERT INTO user(uuid, name, email, password, roleId, entityStatus, entityDatetime) VALUES(?, ?, ?, ?, ?, ?, ?)";

	public UserDao(Connection connection) {
		super(User.class, connection);
	}

	public void save(User user) throws SQLException {
		Object[] params = { user.getUuid(), user.getName(), user.getEmail(),
				user.getPassword(), user.getRoleId(), user.getEntityStatus(),
				user.getEntityDatetime() };
		execute(SQL_INSERT, params);
	}
}
